﻿using OAS.Application.MenuApp.Dtos;
using OAS.Application.MenuApp.Services;
using OAS.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace OAS.Application.MenuApp
{
    public class MenuController : IDynamicApiController
    {
        private readonly ISqlSugarClient db;
        private readonly IMenuService _menuService;
        public MenuController(IMenuService menuService, ISqlSugarClient db)
        {
            this.db = db;
            _menuService = menuService;
        }
        public async Task<List<DtoMenu>> GetMenuList()
        {
            return await _menuService.GetMenuList();
        }
        public async Task AddMenu(Menu menu)
        {
            await _menuService.AddMenu(menu);
        }
        public async Task UpdateMenu(Menu menu)
        {
            await _menuService.UpdateMenu(menu);
        }
        public async Task DeleteMenu(Menu menu)
        {
            await _menuService.DeleteMenu(menu);
        }
    }
}
